﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Card.Manager
{
    public partial class OrderCard : BasePage
    {
        #region
        private int ItemID
        {
            get
            {
                int itemID = 0;
                if (!string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    int.TryParse(Card.Security.Utility.DecryptString(Request.QueryString["id"]), out itemID);
                }
                return itemID;
            }
        }

        private Entity.OrderItem m_Item = null;

        public Entity.OrderItem Item
        {
            get { return m_Item; }
            set { m_Item = value; }
        }

        private Entity.OrderCard m_Card = null;

        public Entity.OrderCard NameCard
        {
            get { return m_Card; }
            set { m_Card = value; }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            this.DoInit();
        }

        #region
        private void DoInit()
        {
            this.m_Item = BLL.OrderItemManager.GetEntity(this.ItemID, this.CPassport);
            
            m_Card = BLL.OrderCardManager.GetEntity(this.m_Item.CardID, this.CPassport);
            //if (m_Card != null && this.Passport.UserID == m_Card.UserID)
            //{                
            //}
            //else
            //{
            //    Response.Redirect("/");
            //}
        }
        #endregion
    }
}
